package org.xu.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.xu.dao.AdapterCarInfoEntityExtMapper;
import org.xu.entity.AdapterCarInfoEntity;
import org.xu.request.CarPageRequest;
import org.xu.service.AdapterCarInfoService;

import java.util.List;

/**
 * @author liuxiaoxu
 */
@Service
public class AdapterCarInfoServiceImpl implements AdapterCarInfoService {
    @Autowired
    private AdapterCarInfoEntityExtMapper mapper;

    @Override
    public int deleteByPrimaryKey(String id) {
        return 0;
    }
    @Override
    public int insert(AdapterCarInfoEntity record) {
        return 0;
    }

    @Override
    public int insertSelective(AdapterCarInfoEntity record) {
        return 0;
    }
    @Override
    public AdapterCarInfoEntity selectByPrimaryKey(String id) {
        return null;
    }

    @Override
    public int updateByPrimaryKeySelective(AdapterCarInfoEntity record) {
        return mapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(AdapterCarInfoEntity record) {
        return 0;
    }

    @Override
    public List<AdapterCarInfoEntity> listCarInfo() {
        return mapper.listCarInfo();
    }

    @Override
    public PageInfo<AdapterCarInfoEntity> pageQuery(CarPageRequest request) {
        PageHelper.startPage(request.getIndex(),request.getPageSize());
        Page<AdapterCarInfoEntity> pageList = mapper.pageQuery(request);
        PageHelper.clearPage();
        return new PageInfo<>(pageList);
    }
}
